Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add ADMIN_UPGRADE_TESTS label to test start-upgrade-test-admin #3355

Closed
wants to merge 3 commits into from

Conversation

julianrubino
Copy link
Member

@julianrubino julianrubino commented Jan 15, 2025

Description

Closes: 2708

This PR introduces the ADMIN_UPGRADE_TESTS label to trigger the start-upgrade-test-admin test in the GitHub Actions workflow.

This change ensures that tests specific to administrative upgrade scenarios can be executed as part of the CI/CD pipeline.

The label is added in the matrix-conditionals job and incorporated into the e2e test strategy matrix.

Key Changes:

  • Added ADMIN_UPGRADE_TESTS handling to the matrix-conditionals job.
  • Included start-upgrade-test-admin in the e2e job matrix.
  • Enabled ADMIN_UPGRADE_TESTS for push, schedule, and workflow_dispatch events.
  • Integrated the label handling into Slack notifications dynamically.

Dependencies

None. This change is self-contained and builds upon the existing e2e workflow.

How Has This Been Tested?

Added the label and start-upgrade-test-admin are running.

  • Tested CCTX in localnet
  • Tested in development environment
  • Go unit tests
  • Go integration tests
  • Tested via GitHub Actions

Summary by CodeRabbit

  • New Features

    • Enhanced GitHub Actions workflow with new conditional testing capabilities
    • Added support for admin upgrade tests in continuous integration pipeline
  • Chores

    • Updated test configuration to improve testing flexibility and coverage

@julianrubino julianrubino self-assigned this Jan 15, 2025
Copy link
Contributor

coderabbitai bot commented Jan 15, 2025

📝 Walkthrough

Walkthrough

The pull request introduces modifications to the .github/workflows/e2e.yml GitHub Actions workflow file. The primary enhancement is the addition of a new output variable ADMIN_UPGRADE_TESTS in the matrix-conditionals job. This variable enables conditional execution of a specific test category based on pull request labels, push events to release branches, or scheduled workflow triggers.

Changes

File Change Summary
.github/workflows/e2e.yml - Added ADMIN_UPGRADE_TESTS output variable to matrix-conditionals job
- Implemented conditional logic for setting ADMIN_UPGRADE_TESTS
- Added new make target start-upgrade-test-admin in e2e job

Possibly related PRs

Suggested Reviewers

  • gartnera
  • skosito

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the ci Changes to CI pipeline or github actions label Jan 15, 2025
@julianrubino julianrubino added no-changelog Skip changelog CI check ADMIN_UPGRADE_TESTS Run make start-upgrade-test-admin and removed ADMIN_UPGRADE_TESTS Run make start-upgrade-test-admin labels Jan 15, 2025
@julianrubino julianrubino removed the ADMIN_UPGRADE_TESTS Run make start-upgrade-test-admin label Jan 15, 2025
@julianrubino julianrubino marked this pull request as ready for review January 15, 2025 19:50
@julianrubino julianrubino requested a review from a team as a code owner January 15, 2025 19:50
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
.github/workflows/e2e.yml (1)

26-26: Consider adding concurrency group for admin upgrade tests.

While the workflow has a global concurrency group, consider adding a specific concurrency group for admin upgrade tests to prevent resource conflicts during parallel runs.

 concurrency:
   group: e2e-${{ github.head_ref || github.sha }}
   cancel-in-progress: true
+  admin-upgrade:
+    group: admin-upgrade-${{ github.head_ref || github.sha }}
+    cancel-in-progress: true

Also applies to: 246-249

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7eea20e and 06ee509.

📒 Files selected for processing (1)
  • .github/workflows/e2e.yml (7 hunks)
🔇 Additional comments (3)
.github/workflows/e2e.yml (3)

118-118: LGTM: Output variable declaration is consistent with existing pattern.

The ADMIN_UPGRADE_TESTS output variable is correctly declared following the established pattern in the matrix-conditionals job.


151-151: LGTM: Comprehensive event handling for ADMIN_UPGRADE_TESTS.

The ADMIN_UPGRADE_TESTS flag is properly integrated across all relevant event contexts:

  • Pull request label detection
  • Release branch push events
  • Scheduled runs
  • Manual workflow dispatch

Also applies to: 182-182, 194-194, 208-208


246-249: Verify timeout configuration for admin upgrade tests.

The new test target "start-upgrade-test-admin" is configured with a 40-minute timeout, which matches the timeout of similar upgrade tests like "start-upgrade-import-mainnet-test". However, let's verify if this timeout is sufficient.

Run this script to analyze historical run times of similar upgrade tests:

✅ Verification successful

Timeout configuration for admin upgrade tests is appropriate

The 40-minute timeout aligns with all other resource-intensive operations in the workflow, including similar upgrade tests, stateful data tests, and migration tests. This consistent pattern across comparable operations suggests the timeout is well-calibrated.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check historical run times of upgrade tests to validate timeout configuration

gh run list --workflow=e2e.yml --json conclusion,durationInMinutes,jobs --jq '.[] | select(.conclusion=="success") | .jobs[] | select(.name | contains("upgrade")) | {name: .name, duration: .durationInMinutes}' | head -n 10

Length of output: 467


Script:

#!/bin/bash
# Get historical run times for upgrade tests using available fields
gh run list --workflow=e2e.yml --json conclusion,startedAt,updatedAt,jobs --jq '
  .[] | 
  select(.conclusion=="success") | 
  .jobs[] | 
  select(.name | contains("upgrade")) | 
  {
    name: .name,
    duration: (
      (
        (fromdateiso8601(.updatedAt) - fromdateiso8601(.startedAt)) / 60
      ) | floor
    )
  }
' | head -n 10

Length of output: 570


Script:

#!/bin/bash
# Search for timeout configurations in upgrade-related jobs
echo "Searching for upgrade test configurations:"
rg "start-upgrade.*\n.*timeout-minutes:" .github/workflows/e2e.yml -A 1

echo -e "\nSearching for all timeout configurations:"
rg "timeout-minutes:" .github/workflows/e2e.yml -B 2

Length of output: 1305

@gartnera gartnera added the ADMIN_UPGRADE_TESTS Run make start-upgrade-test-admin label Jan 15, 2025
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kinda need to add a parameter on the e2e side to wait for the upgrade to complete before running the actual tests. start-upgrade-test-admin is a bit of a race condition.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this test responsible for upgrading the network itself and then waiting for the upgrade to complete before running the actual tests?

https://github.com/zeta-chain/node/actions/runs/12795341388/job/35675082412?pr=3355

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm saying on the e2e side there's nothing to prevent the actual admin tests from starting to run before the network has actually upgraded.

@gartnera
Copy link
Member

tx failed: failed to execute message; message index: 0: msg: /***.zetacore.observer.MsgUpdateOperationalFlags: authorization not found: sender not authorized

Oh yeah we can't actually run this test in CI because people refuse to do automated authorization migrations 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ADMIN_UPGRADE_TESTS Run make start-upgrade-test-admin ci Changes to CI pipeline or github actions no-changelog Skip changelog CI check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a label ADMIN_UPGRADE_TESTS to test start-upgrade-test-admin
2 participants